import json

jsonstr = {"status": 200,
           "data": {"realname": "test", "linkman": "ttt", "address": "\u9910\u5385\u5730\u57401", "go_time": "08:10",
                    "boss_name": "\u6211\u662f\u8001\u677f", "boss_phone": "13800138000", "check_name": "123",
                    "check_phone": "13800138000", "cook_name": "8", "cook_phone": "13800138000", "order_name": "123",
                    "order_phone": "456", "urgency_name": "789", "urgency_phone": "0", "pay_email": "6",
                    "pay_person": ""}}

datastr = jsonstr["data"]
print(datastr)

keys = datastr.keys()

for k in keys:
    print("val " + k.upper() + " = \"" + k + "\"")

print("-" * 60)

s = """
        @SerializedName("realname") val realname: String, //test
        @SerializedName("linkman") val linkman: String, //ttt
        @SerializedName("address") val address: String, //餐厅地址1
        @SerializedName("go_time") val goTime: String, //08:10
        @SerializedName("boss_name") val bossName: String, //我是老板
        @SerializedName("boss_phone") val bossPhone: String, //13800138000
        @SerializedName("check_name") val checkName: String, //123
        @SerializedName("check_phone") val checkPhone: String, //13800138000
        @SerializedName("cook_name") val cookName: String, //8
        @SerializedName("cook_phone") val cookPhone: String, //13800138000
        @SerializedName("order_name") val orderName: String, //123
        @SerializedName("order_phone") val orderPhone: String, //456
        @SerializedName("urgency_name") val urgencyName: String, //789
        @SerializedName("urgency_phone") val urgencyPhone: String, //0
        @SerializedName("pay_email") val payEmail: String, //6
        @SerializedName("pay_person") val payPerson: String
"""

for line in s.splitlines():
    left = line.split("//")[0]
    try:
        right = line.split("//")[1]
    except:
        continue
    start = left.find("\"")
    end = left.rfind("\"")
    old = left[start + 1:end]
    # result = left.replace(old, "EditInfoKey." + old.upper()).replace("\"","")
    result = left[:start] + "EditInfoKey." + old.upper() + left[end + 1:]
    print(result + " // " + right)
